package cn.lyj.entity;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * SaleProduct entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "SALE_PRODUCT")

public class SaleProduct implements java.io.Serializable {

	// Fields

	private BigDecimal prodId;
	private String prodName;
	private Double prodPrice;
	private String prodnb;
	
	// Constructors

	/** default constructor */
	public SaleProduct() {
	}

	/** full constructor */
	public SaleProduct(BigDecimal prodId, String prodName, Double prodPrice) {
		this.prodId = prodId;
		this.prodName = prodName;
		this.prodPrice = prodPrice;
	}

	// Property accessors
	@Id
	@Column(name = "PROD_ID")
	@GenericGenerator(name="incrementName",strategy="increment")
	@GeneratedValue(generator="incrementName")
	public BigDecimal getProdId() {
		return this.prodId;
	}

	public void setProdId(BigDecimal prodId) {
		this.prodId = prodId;
	}

	@Column(name = "PROD_NAME", nullable = false, length = 100)

	public String getProdName() {
		return this.prodName;
	}

	public void setProdName(String prodName) {
		this.prodName = prodName;
	}

	@Column(name = "PROD_PRICE", nullable = false, precision = 126, scale = 0)

	public Double getProdPrice() {
		return this.prodPrice;
	}

	public void setProdPrice(Double prodPrice) {
		this.prodPrice = prodPrice;
	}

	@Transient
	public String getProdnb() {
		return prodName+"-"+prodPrice;
	}

	public void setProdnb(String prodnb) {
		this.prodnb = prodnb;
	}
	
	
}